package leetcode.code2216;

import leetcode.IDebug;
import leetcode.helper.H;

public class Solution implements IDebug {

	public int minDeletion(int[] nums) {
		int len = nums.length;
		int delete = 0;
		int p = 1;
		while (p < len) {
			if (nums[p] == nums[p - 1]) {
				delete += 1;
				p += 1;
			} else {
				p += 2;
			}
		}
		if (((len - delete) & 1) == 1) {
			delete += 1;
		}
		return delete;
	}

	@Override
	public void debug4() {
		H.compare(2, this.minDeletion(H.str2array3("[1,1,2,2,3,3]")));

	}

	@Override
	public void debug3() {
		// TODO Auto-generated method stub

	}

	@Override
	public void debug2() {
		// TODO Auto-generated method stub

	}

	@Override
	public void debug1() {
		// TODO Auto-generated method stub

	}

	public static void main(String[] args) {
		Solution so = new Solution();
		so.debug1();
		so.debug2();
		so.debug3();
		so.debug4();

	}

}
